<template>
  <div
    class="myshow.vue"
    style="width:100%"
  >
    <div v-if="!$store.state.isbusNewsDitle">
      <div>
        <img
          src="../../../assets/imges/rongyuzhanshi.png"
          alt=""
        >
        <div class="show_box">
          <div
            @click="handDetails(item)"
            v-for="item in sonList"
            class="show_item pointer"
          >
            <div class="show_img_box">
              <img
                class="show_img"
                :src="item.img"
                alt=""
              >
            </div>
            <div class="show_item_title">
              {{item.title}}
            </div>
          </div>
        </div>
      </div>
      <div class="page_box">
        <el-pagination
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
          :page-sizes="[5,10,15]"
          :page-size="pageBid3.limit"
          layout="total, prev, pager, next, jumper"
          :total="pageBid3.totalCount"
        >
        </el-pagination>
      </div>
    </div>
    <transition name="fade">
      <div
        v-if="$store.state.isbusNewsDitle"
        class="busDitle_dog"
      >
        <mydetails
          :sonList="sonList"
          :dateils="dateils"
        >
        </mydetails>
      </div>
    </transition>
  </div>
</template>

<script>
import pager from "@/components/pager.vue";
export default {
  name: "myshow.vue",
  components: {
    pager
  },
  props: {
    sonList: {
      type: Array
    },
    count: {
      type: Number
    }
  },
  watch: {
    sonList(newlIst, olist) {
      newlIst.forEach(item => {
        item.img = this.$store.state.baseUrl + item.img;
      });
    },
    count(newlIst, olist) {
      this.pageBid3.totalCount = this.count;
      console.log(this.pageBid3.totalCount, "5");
    }
  },
  data() {
    return {
      pageBid3: {
        start: 1,
        limit: 10,
        totalCount: 0,
        tatalpage: 0
      },
      dateils: {}
    };
  },
  mounted() {
    this.pageBid3.totalCount = this.count;
  },
  methods: {
    handDetails(item) {
      this.dateils = item;
      this.$store.commit("handBus", true);
    },
    handleSizeChange() {},
    handleCurrentChange() {
      this.$emit("handSonNav", this.$parent.activeId, val, 10);
    }
  }
};
</script>

<style lang='scss' scoped>
.page_box {
  text-align: center;
  margin-top: 50px;
  margin-bottom: 30px;
}
.show_box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 29px;
  flex-wrap: wrap;
  .show_item {
    border: 1px solid rgba(204, 204, 204, 1);
    margin-bottom: 20px;
    .show_item_title {
      width: 198px;
      height: 54px;
      text-align: center;
      line-height: 54px;
      color: #333333;
      font-size: 10px;
      border-top: 1px solid rgba(204, 204, 204, 1);
    }
    .show_img_box {
      width: 198px;
      height: 131px;
      padding: 16px;

      .show_img {
        width: 165px;
        height: 99px;
      }
    }
  }
}
</style>
